﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


@section Head
{
    @Html.Css("EditForm", "RightSeparateModule", "dp")
    @Html.Js("datepicker")
 
    <script type="text/javascript">

        $(function () {
            $("#planTime").datepicker({ picker: "<img class='picker' align='middle' src='../../Images/icons/s.gif' alt=''/>" });
            $("#planTime")
            var mainheight = document.documentElement.clientHeight;
            var mainWidth = document.documentElement.clientWidth - 10;
            var gh = mainheight - 120;
            var option = {
                height: gh,
                width: mainWidth,
                url: '@Url.Action("GetInPlan")',
                colModel: [
                     { display: 'ID', name: 'ID', width: 60, sortable: false, align: 'left', hide: true, iskey: true },
                     { display: '物品编号', name: 'ArticleNO', width: 120, sortable: false, hide: false, align: 'left' },
                     { display: '物品名称', name: 'ArticleName', width: 120, sortable: false, hide: false, align: 'left' },
                      { display: '物品规格', name: 'ArticleUnit', width: 120, sortable: false, hide: false, align: 'left' },
                     { display: '当前日期库存', name: 'STOCKS_COUNT', width: 80, sortable: false, hide: false, align: 'left' },
                     { display: '指定日期库存', name: 'BRING_COUNT', width: 80, sortable: false, hide: false, align: 'left' }
                   
               	],
                singleselected: false,
                sortname: "Sequence",
                sortorder: "asc",
                title: false,
                usepager: true,
                page: 1,
                rp: 20,
                rpoption: [10, 15, 20],
                showcheckbox: true,
                selectedonclick: true, //点击行是否选中
                rowbinddata: true
            };
            var instockgrid = $("#InPlanList").flexigrid(option);
          
            $("#btnQuery").bind("click", function () {
                var no = $('#personNo').val() == null ? "" : $('#personNo').val();
                var na = $('#personName').val() == null ? "" : $('#personName').val();
                var nc = $('#planTime').val() == null ? "" : $('#planTime').val();
                option.query = no+","+na+","+nc;
                option.newp = 0;
                $('#InPlanList').flexOptions(option).flexReload();
            });
            function refresh() {
                $("#InPlanList").flexOptions(option).flexReload();
            }
           
        });
    </script>
}
<div id="container">
    <div id="mainContent">
        <div id="title" class="title">
            进货计划表</div>
        <div class="title" style="height: 30px;">
             物品编号： @Html.TextBox("personName")
             物品名称：@Html.TextBox("personNo")
             指定日期:@Html.TextBox("planTime", DateTime.Now.Date.ToString("yyyy-MM-dd"), new { @ReadOnly = true })
            <input type="button" value="查询" id="btnQuery" style="width: 62px; height: 23px;" />
        </div>
        <table id="InPlanList" style="display: none;">
        </table>
    </div>
</div>
